﻿using yao.Entity;
using yao.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using Titan;

namespace yao.website.Controllers
{
    /// <summary>
    /// 地图
    /// </summary>
    public class MapController : BaseController
    {
        public ActionResult Index()
        {
            using (IDbSession cn = OpenSession())
            {
                QueryExpression q = new QueryExpression();
                q.EntityType = typeof (Customer);
                q.Selects.Add(Customer_.CustomerId); //唯一Id
                q.Selects.Add(Customer_.CustomerNo); //客户编号
                q.Selects.Add(Customer_.CustomerName); //客户名称
                q.Selects.Add(Customer_.Address); //地址
                q.Selects.Add(Customer_.X); //地址
                q.Selects.Add(Customer_.Y); //地址
                q.Wheres.Add(Customer_.CompanyId.TEqual(CurrentEmployee.CompanyId));
                Customers customers = new Customers();
                customers.TotalCount = cn.SelectCollection(customers.Items, q);
                return View(customers);
            }
        }

    }
}
